package com.asia5b.debugapp.createorder

import android.widget.Button
import com.asia5b.debugapp.R
import com.chad.library.adapter.base.BaseQuickAdapter
import com.chad.library.adapter.base.viewholder.BaseViewHolder

/**
 * Created by zhangyuncai on 2020/8/7.
 */
class ActionAdapter(list: MutableList<ActionBean>) :
        BaseQuickAdapter<ActionBean, BaseViewHolder>(R.layout.item_debug_action, list) {
    override fun convert(helper: BaseViewHolder, item: ActionBean) {
        (helper.itemView as Button).text = item.name
        item.onClickListener?.let {
            (helper.itemView as Button).setOnClickListener(item!!.onClickListener)
        }
    }
}